﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace Web.Views.Common
{
    public partial class TrainSearch : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                 if (Request["StartStation"] != null && Request["EndStation"]!=null)
                 {
                     string from = HttpUtility.UrlDecode(Request["StartStation"].ToString());
                     string to =   HttpUtility.UrlDecode(Request["EndStation"].ToString());
                     this.Title = from + "--" + to+ " -easydp.net|容易订票网 ";
                     this.odsTrainStation.SelectParameters["sStation"].DefaultValue = from;
                     this.odsTrainStation.SelectParameters["eStation"].DefaultValue = to;
                     this.gdvTrainStation.DataBind();
                     
                 }
            }

            
        }
        protected void lbtnGet_Click(object sender, EventArgs e)
        {
            if (Request.QueryString["StartStation"] != null && Request.QueryString["EndStation"] != null)
            {
                Panny.TrainData.TrainStation ts = new Panny.TrainData.TrainStation("ConnectionString");
                ts.SearchByStationName(HttpUtility.UrlDecode(Request["StartStation"].ToString()), HttpUtility.UrlDecode(Request["EndStation"].ToString()));
                this.gdvTrainStation.DataBind();
            }
        }
       
    }
}
